<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
	response.setHeader("Pragma", "no-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<html>
	<head>
		<link>
		<title></title>
		<!-- 通用模板css引用 -->
		<!-- 页面Head由引用模板的子页面来替换 -->
	</head>
	<body>
<script type="text/javascript" src="<%=path%>/js/jquery/jquery-1.4.2.js"></script>




		<div id="gradient">
			<tr>
				<td width="10%">用户</td>
				<td width="90%">
				<select name="columnInfo" id="columnInfo">
					<option value="0">--请选择--</option>
						<option value="1">用户1</option>
						<option value="2">用户2</option>
						<option value="3">用户3</option>
						<option value="4">用户4</option>
						<option value="5">用户5</option>
				</select>
				
				<select name="subColumnInfo" id="subColumnInfo"></select></td>
			</tr>
		</div>
	
	
	<div>
        <input id="name" type="text">
        <input type="button" value="ok" onclick="javascript:clickButton();">
	</div>
	
	
	<script type="text/javascript">
	/**
	
	$(function(){          
	$("#columnInfo").change(function(){    
		$.getJSON("/ajax/test/ajax.do",{userId:$(this).val()},function(myJSON){                  
			var myOptions="";                  
			for(var i=0;i<myJSON.length;i++){                     
				 myOptions += '<option value="' + myJSON[i].optionValue + '">' +
					myJSON[i].optionDisplay + '</option>';                  
                 }                 
             $("#subColumnInfo").empty();                  
             $("#subColumnInfo").html(myOptions);     
             //alert("change");                 
       	});          
   	});          
   	$("#columnInfo").change();      
}) 
**/
	</script>



<SCRIPT type="text/javascript">
            function clickButton()
            {    
                var url = '/ajax/test/hello.do';
                var params = {
                        name:$('#name').attr('value')
                };
                //alert(params);
                jQuery.post(url, params, callbackFun, 'json');
            }
            function callbackFun(data)
            {
            	alert(data);
                document.write(data.helloword+":"+data.userId);//对应HelloWorld类的message属性
                //获取数据后渲染页面
            }
        </SCRIPT>
	</body>
</html>
